home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / comm / mpmod160.zip / SOURCE.ZIP / Z-GEN.H < prev    next >
Text File  |  1994-01-01  |  6KB  |  158 lines

  1. /*--------------------------------------------------------------------------*/
  2. /* Header file containing all definitions specific to Zmodem transfers.     */
  3. /*--------------------------------------------------------------------------*/
  4.  
  5. #define ZPAD            '*'
  6. #define ZDLE            030
  7. #define ZDLEE           (ZDLE^0100)
  8. #define ZBIN            'A'
  9. #define ZHEX            'B'
  10. #define ZBIN32          'C'
  11. /*
  12. Here are the two new indicators. These are used in GetHeader (ZMISC.C) to
  13. determine the type of header.
  14. */
  15. #define ZBINC           'G'            /* Compression & CRC-16              */
  16. #define ZBINC32         'H'            /* Compression & CRC-32              */
  17.  
  18. /*
  19.  Frame types
  20. */
  21. #define ZRQINIT    0
  22. #define ZRINIT     1
  23. #define ZSINIT     2
  24. #define ZACK       3
  25. #define ZFILE      4
  26. #define ZSKIP      5
  27. #define ZNAK       6
  28. #define ZABORT     7
  29. #define ZFIN       8
  30. #define ZRPOS      9
  31. #define ZDATA      10
  32. #define ZEOF       11
  33. #define ZFERR      12
  34. #define ZCRC       13
  35. #define ZCHALLENGE 14
  36. #define ZCOMPL     15
  37. #define ZCAN       16
  38. #define ZFREECNT   17
  39. #define ZCOMMAND   18
  40. #define ZSTDERR    19
  41.  
  42. /*
  43.  ZDLE sequences
  44. */
  45. #define ZCRCE           'h'            /* CRC next/frame ends/hdr follows   */
  46. #define ZCRCG           'i'            /* CRC next/frame continues nonstop  */
  47. #define ZCRCQ           'j'            /* CRC next/frame continues/want ZACK*/
  48. #define ZCRCW           'k'            /* CRC next/ZACK expected/end of frame*/
  49. #define ZRUB0           'l'            /* Translate to rubout 0177          */
  50. #define ZRUB1           'm'            /* Translate to rubout 0377          */
  51.  
  52. /*
  53. These are the brand new frame ends which will be sent by the sender to tell
  54. the receiver that the packet just sent is a compressed packet. The compressed
  55. packet can be any valid packet from full streaming to wait.
  56. */
  57. #define ZCRCE_C         'p'            /* as ZCRCE plus using compression.  */
  58. #define ZCRCG_C         'q'            /* as ZCRCG plus using compression.  */
  59. #define ZCRCQ_C         'r'            /* as ZCRCQ plus using compression.  */
  60. #define ZCRCW_C         's'            /* as ZCRCW plus using compression.  */
  61.  
  62. /*--------------------------------------------------------------------------*/
  63. /* Z_GetZDL return values (internal)                                        */
  64. /* -1 is general error, -2 is timeout                                       */
  65. /*--------------------------------------------------------------------------*/
  66. #define GOTOR           256
  67. #define GOTCRCE         (ZCRCE|GOTOR)  /* ZDLE-ZCRCE received  (Dec. 360)   */
  68. #define GOTCRCG         (ZCRCG|GOTOR)  /* ZDLE-ZCRCG received  (Dec. 361)   */
  69. #define GOTCRCQ         (ZCRCQ|GOTOR)  /* ZDLE-ZCRCQ received  (Dec. 362)   */
  70. #define GOTCRCW         (ZCRCW|GOTOR)  /* ZDLE-ZCRCW received  (Dec. 363)   */
  71.  
  72. /*
  73. These are the brand new frame ends which will be sent by the sender to tell
  74. the receiver that the packet just sent is a compressed packet. The compressed
  75. packet can be any valid packet from full streaming to wait.
  76. */
  77. #define GOTCRCE_C     (ZCRCE_C|GOTOR)  /* As GOTCRCE plus using compression */
  78. #define GOTCRCG_C     (ZCRCG_C|GOTOR)  /* As GOTCRCG plus using compression */
  79. #define GOTCRCQ_C     (ZCRCQ_C|GOTOR)  /* As GOTCRCQ plus using compression */
  80. #define GOTCRCW_C     (ZCRCW_C|GOTOR)  /* As GOTCRCW plus using compression */
  81.  
  82. /*
  83.  Byte positions within header array
  84. */
  85. #define ZF0             3              /* First flags char                  */
  86. #define ZF1             2
  87. #define ZF2             1
  88. #define ZF3             0
  89.  
  90. #define ZP0             0              /* Low order 8 bits of position      */
  91. #define ZP1             1
  92. #define ZP2             2
  93. #define ZP3             3              /* High order 8 bits of file pos     */
  94.  
  95.  
  96. /*
  97.  Bit Masks for ZRINIT flags char ZF0
  98. */
  99. #define CANFDX          1             /* Can send and receive true FDX     */
  100. #define CANOVIO         2             /* Can receive data during disk I/O  */
  101. #define CANBRK          4             /* Can send a break signal           */
  102. #define CANFC32         32            /* Can use 32 bit Frame Check        */
  103. #define ESCCTL          64       /* Receiver expects ctl chars to be escaped */
  104. #define ESC8            128      /* Receiver expects 8th bit to be escaped   */
  105.  
  106. /*
  107.  Bit Masks for ZRINIT flags char ZF1
  108.  
  109.  These masks are essential for Zreceive/Zsend to determine whether we can
  110.  send or receive in fast mode and/or compressed mode.
  111. */
  112. #define CANFAST          4            /* Transfer without escaping (exc. DLE*/
  113. #define CANBIG           8            /* Can send 4096 byte blocks.         */
  114. #define CANCOMP         16            /* Can transfer using compression.    */
  115.  
  116.  
  117. /*
  118.  Bit Masks for ZSINIT flags byte ZF0
  119. */
  120. #define TESCCTL         64   /* Transmitter expects ctl chars to be escaped */
  121. #define TESC8           128    /* Transmitter expects 8th bit to be escaped */
  122.  
  123.  
  124. /*
  125.  Conversion options - generally we want ZCRESUM
  126. */
  127. #define ZCBIN           1              /* Binary transfer - no conversion   */
  128. #define ZCNL            2              /* Convert NL to local EOLN          */
  129. #define ZCRESUM         3              /* Resume interrupted file transfer  */
  130.  
  131.  
  132.  
  133. #define ZMSKNOLOC       0200           /* Skip file if not present at rx    */
  134.  
  135. /*
  136.  Management options
  137.  These are ignored by MpModem - rather irrelevant.
  138. */
  139. #define ZMMASK          31        /* Mask for the choices below             */
  140. #define ZMNEWL          1         /* Transfer if source newer/longer        */
  141. #define ZMCRC           2         /* Transfer if different CRC/length       */
  142. #define ZMAPND          3         /* Append contents to existing file       */
  143. #define ZMCLOB          4         /* Replace existing file                  */
  144. #define ZMNEW           5         /* Transfer if source newer               */
  145. #define ZMDIFF          6         /* Transfer if dates or lengths different */
  146. #define ZMPROT          7         /* Protect destination file               */
  147. #define ZMCHNG          8         /* Change filename if destination exists  */
  148.  
  149. [...]
  150. /*
  151.  Miscellaneous definitions
  152. */
  153. #define ZOK             0
  154. #define ZERROR          (-1)
  155. #define ZTIMEOUT        (-2)
  156.  
  157. [...]
  158.